function setCookie(name,value,min){
	var str = name + "=" + escape(value);
	if(min > 0){
		var date = new Date();
		var ms = min * 60 * 1000;
		date.setTime(date.getTime() + ms);
		str += "; expires=" + date.toGMTString();
	}
	document.cookie = str;
}

function getCookie(name){
	var arrStr = document.cookie.split("; ");
	for(var i = 0;i < arrStr.length;i ++){
		var temp = arrStr[i].split("=");
		if(temp[0] == name) return unescape(temp[1]);
	} 
}
